package cn.youth996.controller;

import cn.youth996.service.WeChatArticleService;
import cn.youth996.utils.Result;
import cn.youth996.vo.SysArticleDetailVo;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 微信公众号文章控制器
 *
 * @author Zhan Xinjian
 * @date 2025/9/16
 */
@RestController
public class WeChatArticleController {
    @Autowired
    private WeChatArticleService weChatArticleService;
    @PostMapping("/")
    public Result<Boolean> add(@RequestBody SysArticleDetailVo sysArticle) throws IOException, WxErrorException {
        weChatArticleService.add(sysArticle);
        return Result.success();
    }
}
